﻿/// <reference path="TsLinq.d.ts" />
var KeyValuePair = (function () {
    function KeyValuePair(key, value) {
        this.key = key;
        this.value = value;
    }
    return KeyValuePair;
})();

var KeyValueComparerForKey = (function () {
    function KeyValueComparerForKey(keyComparer) {
        this.keyComparer = keyComparer;
    }
    KeyValueComparerForKey.prototype.compare = function (entry1, entry2) {
        if (this.keyComparer !== undefined) {
            return this.keyComparer.compare(entry1.key, entry2.key);
        }
        if (entry1.key < entry2.key)
            return -1;
        if (entry1.key == entry2.key)
            return 0;
        return 1;
    };
    return KeyValueComparerForKey;
})();

var KeyValueComparerForValue = (function () {
    function KeyValueComparerForValue(valueComparer) {
        this.valueComparer = valueComparer;
    }
    KeyValueComparerForValue.prototype.compare = function (entry1, entry2) {
        if (this.valueComparer !== undefined) {
            return this.valueComparer.compare(entry1.value, entry2.value);
        }
        if (entry1.value < entry2.value)
            return -1;
        if (entry1.value == entry2.value)
            return 0;
        return 1;
    };
    return KeyValueComparerForValue;
})();
